<template>
  <div class="main">
    <!-- append-to-body="false"
      :fullscreen="true" -->

    <!-- <el-dialog
      title=""
      :visible.sync="dialogVisible"
      width="100%"
      :modal-append-to-body="false"
      :destroy-on-close="true"
      custom-class="look-info"
      :before-close="handleClose"
    > -->

    <!-- <div style="width:10vw">
        <sidebar class="sidebar-container" />
    </div> -->
    <!-- 标题 -->
    <Title :title="title" />
    <div style="">
      <!-- <div style="margin-bottom:1vh"> -->
      <!-- <navbar /> -->
      <!-- </div> -->

      <el-row
        style="margin:0 0 10px 0; display: flex;justify-content:flex-end;padding:0 3vw;align-items:center;position: relative;margin-top: -20px;"
      >
        <div style="margin:0 2vw">
          <el-button type="primary" icon="el-icon-back" @click="$router.go(-1)" />
        </div>

        <el-button
          v-if="role === '管理员' || role === '超级管理员'"
          type="primary"
          @click="openInnerVisible"
        >查看评审</el-button>
      </el-row>

      <!-- 缩小版表格 -->
      <el-row v-if="big_or_small === 0">
        <el-col :span="isLook ? 24 : 13">
          <el-card class="box-card" :body-style="{padding:0,}">

            <!-- 表格重做 -->
            <div style="margin:0 auto;">

              <!-- <div style="text-align:center;margin-top:10px;">个人简历</div> -->
              <div style=";font-family:MicrosoftYaHei;margin:0 auto;width:100%;height:5vh;line-height:5vh;background:#305fb4;color:#fff;text-align:center;font-weight:bold;font-size:1.2rem">申请人资料</div>

              <div style="display:flex;align-items:center;justify-content:space-around;margin:3vh 0;font-weight: bold;font-family:MicrosoftYaHei;">
                <div>
                  <p style="font-size:.8vw">应聘单位：{{ personnelDetail.apply_college }}</p>
                </div>
                <div>
                  <p style="font-size:.8vw">应聘岗位：{{ personnelDetail.apply_post }}</p>
                </div>
                <div>
                  <p style="font-size:.8vw">拟加入团队：{{ personnelDetail.apply_team }}</p>
                </div>
              </div>

              <table class="table table-striped table-bordered" align="center" valign="center" style="width:80%">

                <tr>
                  <!-- <td class="column" colspan="7">基本信息</td> -->

                </tr>
                <tr>
                  <td class="column">姓名</td>
                  <td class="value">{{ personnelDetail.name }}</td>
                  <td class="column">英文名</td>
                  <td class="value">{{ personnelDetail.english_name }}</td>
                  <td class="column">年龄</td>
                  <td class="value">{{ personnelDetail.age }}</td>

                  <td rowspan="5" class="value">
                    <div class="avatar-img avatar-img1" style="/* background-color: red; */">
                      <img
                        style="width: 138px"
                        :src="baseUrl + personnelDetail.avatar"
                        alt=""
                      >
                    </div>
                  </td>
                </tr>
                <tr>
                  <td class="column">性别</td>
                  <td class="value">{{
                    personnelDetail.sex == "0" ? "男" : "女"
                  }}</td>
                  <td class="column">国籍</td>
                  <td class="value">{{ personnelDetail.nationality }}</td>
                  <td class="column">籍贯</td>
                  <td class="value">{{ personnelDetail.native_place }}</td>

                  <!-- <td class="value"></td> -->
                </tr>
                <tr>
                  <td class="column">出生年月</td>
                  <td class="value">{{ personnelDetail.birth_time }}</td>
                  <td class="column">民族</td>
                  <td class="value">{{ personnelDetail.nation }}</td>
                  <td class="column">政治面貌</td>
                  <td class="value">{{
                    personnelDetail.political_outlook
                  }}</td>
                  <!-- <td class="value"></td> -->
                </tr>
                <tr>
                  <td class="column">最高学位</td>
                  <td class="value" colspan="2">{{ personnelDetail.degree }}</td>
                  <td class="column">身份证(护照)号</td>
                  <td class="value" colspan="2">{{ personnelDetail.id_card }}</td>
                  <!-- <td class="value"></td> -->

                </tr>
                <tr>
                  <td class="column">现从事学科</td>
                  <td class="value" colspan="2">{{ personnelDetail.school }}</td>
                  <td class="column">现研究方向</td>
                  <td class="value" colspan="2">{{ personnelDetail.research }}</td>
                  <!-- <td class="value" ></td> -->
                </tr>
                <tr rowspan="3">
                  <td class="column">手机号码</td>
                  <td class="value" colspan="2">{{ personnelDetail.mobile }}</td>
                  <td class="column">邮箱</td>
                  <td class="value" colspan="3">{{ personnelDetail.email }}</td>
                  <!-- <td class="value" ></td> -->
                </tr>
                <tr>
                  <td class="column">配偶姓名</td>
                  <td class="value" colspan="2">{{ personnelDetail.spouse_name }}</td>
                  <td class="column">工作单位</td>
                  <td class="value" colspan="3">{{ personnelDetail.spouse_unit }}</td>
                  <!-- <td class="value" ></td> -->
                </tr>
                <tr>
                  <td class="column">学历学位</td>
                  <td class="value" colspan="2">{{ personnelDetail.spouse_degree }}</td>
                  <td class="column">毕业院校</td>
                  <td class="value" colspan="3">{{ personnelDetail.spouse_school }}</td>
                  <!-- <td class="value" ></td> -->
                </tr>
                
                <tr>
                  <!-- <td class="column">教育经历(从本科填起)</td> -->
                  <td class="value" colspan="7" style="text-align:left">
                    教育经历(从本科填起) ：
                  </td>

                </tr>
                <tr>
                  <td class="value" colspan="1">学位</td>
                  <td class="value" colspan="1">起始时间</td>
                  <td class="value" colspan="1">终止时间</td>
                  <td class="value" colspan="1">国家或地区</td>
                  <td class="value" colspan="2">院校专业</td>
                  <td class="value" colspan="1">导师</td>
                </tr>
                <tr v-for="(item, index) in personnelDetail.teach_undergo" :key="index">
                  <td class="value" colspan="1">{{ item.degree }}</td>
                  <td class="value" colspan="1">{{ item.startDate }}</td>
                  <td class="value" colspan="1">{{ item.endDate }}</td>
                  <td class="value" colspan="1">{{ item.location }}</td>
                  <td class="value" colspan="2">{{ item.major }}</td>
                  <td class="value" colspan="1">{{ item.tutor }}</td>
                </tr>

                <tr>
                  <!-- <td class="column">教育经历(从本科填起)</td> -->
                  <td class="value" colspan="7" style="text-align:left">
                    工作经历 ：
                  </td>

                </tr>
                <tr>
                  <td class="value" colspan="1">职称</td>
                  <td class="value" colspan="1">起始时间</td>
                  <td class="value" colspan="1">终止时间</td>
                  <td class="value" colspan="1">国家或地区</td>
                  <td class="value" colspan="2">工作单位</td>
                  <td class="value" colspan="1">职务</td>
                </tr>
                <tr v-for="(item, index) in personnelDetail.work_undergo" :key="index + 'work'">
                  <td class="value" colspan="1">{{ item.post }}</td>
                  <td class="value" colspan="1">{{ item.startDate }}</td>
                  <td class="value" colspan="1">{{ item.endDate }}</td>
                  <td class="value" colspan="1">{{ item.location }}</td>
                  <td class="value" colspan="2">{{ item.unit }}</td>
                  <td class="value" colspan="1">{{ item.partTime }}</td>
                </tr>

                <tr>
                  <td class="value" colspan="7" style="text-align:left;">
                    国际学术组织任职或兼职：
                    <br>
                    <br>
                    {{ personnelDetail.introduce }}
                    <br>
                    <br>
                  </td>
                </tr>

              </table>
            </div>

          </el-card>
          <!-- 表格 -->
          <!-- 主要项目表格 -->
          <Card :sub-title="mainProjectData.title" :tip="mainProjectData.tip">
            <div slot="content">
              <TableForm
                ref="projectTableForm"
                :config="mainProjectData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要论文表格 -->
          <Card :sub-title="paperData.title" :tip="paperData.tip">
            <div slot="content">
              <TableForm
                ref="paperTableForm"
                :config="paperData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要著作表格 -->
          <Card :sub-title="mainBookData.title" :tip="mainBookData.tip">
            <div slot="content">
              <TableForm
                ref="bookTableForm"
                :config="mainBookData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要获奖表格 -->
          <Card :sub-title="prizeWinningData.title" :tip="prizeWinningData.tip">
            <div slot="content">
              <TableForm
                ref="winTableForm"
                :config="prizeWinningData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 发明专利表格 -->
          <Card :sub-title="patentData.title" :tip="patentData.tip">
            <div slot="content">
              <TableForm
                ref="patentTableForm"
                :config="patentData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 标准规范表格 -->
          <Card :sub-title="standardData.title" :tip="standardData.tip">
            <div slot="content">
              <TableForm
                ref="standardTableForm"
                :config="standardData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <Card v-if="personnelDetail.other" sub-title="其他成果">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.other)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.planning" sub-title="来校后工作规划">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.planning)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.prove" sub-title="成果材料">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.prove)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.recommendation" sub-title="专家推荐信">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.recommendation)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <!-- 11111 -->
          <Card v-if="personnelDetail.spouse_resume" sub-title="配偶简历">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.spouse_resume)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
                 
        </el-col>
        <!-- <div v-if="role === '评委'" class="spouse_resume" @click="handlePreview(personnelDetail.spouse_resume)"><i class="el-icon-view el-icon--right" />预览配偶简历</div>  -->
        <!-- 11 -->
        <!-- 专家评价-------------------------------------------------------------------------- -->
        <!-- <el-col :span="isLook ? 0 : 11"> -->
        <el-col v-if="role === '专家' && dialogVisible" :span="isLook ? 0 : 11" class="">

          <!-- <el-col v-if="true" :span="isLook ? 0 : 11" class="" style="position:fixed;top:10.7vh;z-index:999;right:1vw;width:45%;height:10%;line-height:10%;"> -->
          <!-- <el-col :span="isLook ? 0 : 11" v-if="true" class=""> -->
          <Evaluate

            :personnel-id="personnelId.toString()"
            :personnel-detail="personnelDetail"
            @refresh="refresh"
          />
        </el-col>

        <el-col
          v-if="
            role === '评委' &&
              dialogVisible &&
              Object.keys(personnelDetail).length > 0
          "
          :span="isLook ? 0 : 11"
        >
          <Decision

            :census="census"
            :personnel="personnelDetail"
            :expert-list="expertList"
            :treatment="treatment"
            :personnel-id="personnelId.toString()"
            @refresh="refresh"
            @handlePreview1="handlePreview"
          />
        </el-col>

      </el-row>

      <!-- 放大版表格 -->
      <el-row v-if="big_or_small === 1" style="width:100%;margin:0 auto">

        <el-col :span="isLook ? 24 : 13">

          <el-card class="box-card" :body-style="{padding:0,background:'#EDF3FB',}">

            <!-- 表格重做 -->
            <div style="margin:0 auto;position: relative;">
              <img class="bg-left" src="@/assets/images/bg_left.jpg" alt="">
              <img class="bg-right" src="@/assets/images/bg_right.jpg" alt="">
              <!-- <div style="text-align:center;margin-top:10px;">个人简历</div> -->
              <div style="width:100vw;font-family:MicrosoftYaHei;margin:0 auto;width:100%;height:5vh;line-height:5vh;background:#305fb4;color:#fff;text-align:center;font-weight:bold;font-size:1.2rem">申请人资料</div>
              <!-- <div class="bgt"></div> -->

              <div style="display:flex;align-items:center;justify-content:space-around;margin:3vh 0;font-weight: bold;font-family:MicrosoftYaHei;width:950px;margin:auto">
                <div>
                  <p style="font-size:.8vw">应聘单位 ：{{ personnelDetail.apply_college }}</p>
                </div>
                <div >
                  <p style="font-size:.8vw">应聘岗位 ：{{ personnelDetail.apply_post }}</p>
                </div>
                <div>
                  <p style="font-size:.8vw">拟加入团队 ：{{ personnelDetail.apply_team }}</p>
                </div>
              </div>

              <div style="display:flex;position: relative;">
                <!-- <div style="width:25%;height:100vh;background:yellow"></div> -->

                <table class="table table-striped table-bordered" align="center" valign="center">

                  <tr>
                    <!-- <td class="column" colspan="7">基本信息</td> -->

                  </tr>
                  <tr>
                    <td class="column">姓名</td>
                    <td class="value">{{ personnelDetail.name }}</td>
                    <td class="column">英文名</td>
                    <td class="value">{{ personnelDetail.english_name }}</td>
                    <td class="column">年龄</td>
                    <td class="value">{{ personnelDetail.age }}</td>

                    <td class="value" rowspan="5">
                      <div class="avatar-img " >
                        <img
                          style="width: 138px"
                          :src="baseUrl + personnelDetail.avatar"
                          alt=""
                        >
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td class="column">性别</td>
                    <td class="value">{{
                      personnelDetail.sex == "0" ? "男" : "女"
                    }}</td>
                    <td class="column">国籍</td>
                    <td class="value">{{ personnelDetail.nationality }}</td>
                    <td class="column">籍贯</td>
                    <td class="value">{{ personnelDetail.native_place }}</td>

                    <!-- <td class="value"></td> -->
                  </tr>
                  <tr>
                    <td class="column">出生年月</td>
                    <td class="value">{{ personnelDetail.birth_time }}</td>
                    <td class="column">民族</td>
                    <td class="value">{{ personnelDetail.nation }}</td>
                    <td class="column">政治面貌</td>
                    <td class="value">{{
                      personnelDetail.political_outlook
                    }}</td>
                    <!-- <td class="value"></td> -->
                  </tr>
                  <tr>
                    <td class="column">最高学位</td>
                    <td class="value" colspan="2">{{ personnelDetail.degree }}</td>
                    <td class="column">身份证(护照)号</td>
                    <td class="value" colspan="2">{{ personnelDetail.id_card }}</td>
                    <!-- <td class="value"></td> -->

                  </tr>
                  <tr>
                    <td class="column">现从事学科</td>
                    <td class="value" colspan="2">{{ personnelDetail.school }}</td>
                    <td class="column">现研究方向</td>
                    <td class="value" colspan="2">{{ personnelDetail.research }}</td>
                    <!-- <td class="value" ></td> -->
                  </tr>
                  <tr rowspan="3">
                    <td class="column">手机号码</td>
                    <td class="value" colspan="2">{{ personnelDetail.mobile }}</td>
                    <td class="column">邮箱</td>
                    <td class="value" colspan="3">{{ personnelDetail.email }}</td>
                    <!-- <td class="value" ></td> -->
                  </tr>
                  <tr>
                    <td class="column">配偶姓名</td>
                    <td class="value" colspan="2">{{ personnelDetail.spouse_name }}</td>
                    <td class="column">工作单位</td>
                    <td class="value" colspan="3">{{ personnelDetail.spouse_unit }}</td>
                    <!-- <td class="value" ></td> -->
                  </tr>
                  <tr>
                    <td class="column">学历学位</td>
                    <td class="value" colspan="2">{{ personnelDetail.spouse_degree }}</td>
                    <td class="column">毕业院校</td>
                    <td class="value" colspan="3">{{ personnelDetail.spouse_school }}</td>
                    <!-- <td class="value" ></td> -->
                  </tr>
                  <tr>
                    <!-- <td class="column">教育经历(从本科填起)</td> -->
                    <td class="value" colspan="7" style="text-align:left">
                      教育经历(从本科填起) ：
                    </td>

                  </tr>
                  <tr>
                    <td class="value" colspan="1">学位</td>
                    <td class="value" colspan="1">起始时间</td>
                    <td class="value" colspan="1">终止时间</td>
                    <td class="value" colspan="1">国家或地区</td>
                    <td class="value" colspan="2">院校专业</td>
                    <td class="value" colspan="1">导师</td>
                  </tr>
                  <tr v-for="(item, index) in personnelDetail.teach_undergo" :key="index">
                    <td class="value" colspan="1">{{ item.degree }}</td>
                    <td class="value" colspan="1">{{ item.startDate }}</td>
                    <td class="value" colspan="1">{{ item.endDate }}</td>
                    <td class="value" colspan="1">{{ item.location }}</td>
                    <td class="value" colspan="2">{{ item.major }}</td>
                    <td class="value" colspan="1">{{ item.tutor }}</td>
                  </tr>

                  <tr>
                    <!-- <td class="column">教育经历(从本科填起)</td> -->
                    <td class="value" colspan="7" style="text-align:left">
                      工作经历 ：
                    </td>

                  </tr>
                  <tr>
                    <td class="value" colspan="1">职称</td>
                    <td class="value" colspan="1">起始时间</td>
                    <td class="value" colspan="1">终止时间</td>
                    <td class="value" colspan="1">国家或地区</td>
                    <td class="value" colspan="2">工作单位</td>
                    <td class="value" colspan="1">职务</td>
                  </tr>
                  <tr v-for="(item, index) in personnelDetail.work_undergo" :key="index + 'work'">
                    <td class="value" colspan="1">{{ item.post }}</td>
                    <td class="value" colspan="1">{{ item.startDate }}</td>
                    <td class="value" colspan="1">{{ item.endDate }}</td>
                    <td class="value" colspan="1">{{ item.location }}</td>
                    <td class="value" colspan="2">{{ item.unit }}</td>
                    <td class="value" colspan="1">{{ item.partTime }}</td>
                  </tr>

                  <tr>
                    <td class="value" colspan="7" style="text-align:left;">
                      国际学术组织任职或兼职：
                      <br>
                      <br>
                      {{ personnelDetail.introduce }}
                      <br>
                      <br>
                    </td>
                  </tr>

                </table>
                <!-- <div style="width:20vw;height:50vh;background:yellow"></div> -->

              </div>

            </div>

            <div style="padding:1vw" />

          </el-card>
          <!-- 表格 -->
          <!-- 主要项目表格 -->
          <Card :sub-title="mainProjectData.title" :tip="mainProjectData.tip">
            <div slot="content">
              <TableForm
                ref="projectTableForm"
                :config="mainProjectData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要论文表格 -->
          <Card :sub-title="paperData.title" :tip="paperData.tip">
            <div slot="content">
              <TableForm
                ref="paperTableForm"
                :config="paperData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要著作表格 -->
          <Card :sub-title="mainBookData.title" :tip="mainBookData.tip">
            <div slot="content">
              <TableForm
                ref="bookTableForm"
                :config="mainBookData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 主要获奖表格 -->
          <Card :sub-title="prizeWinningData.title" :tip="prizeWinningData.tip">
            <div slot="content">
              <TableForm
                ref="winTableForm"
                :config="prizeWinningData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 发明专利表格 -->
          <Card :sub-title="patentData.title" :tip="patentData.tip">
            <div slot="content">
              <TableForm
                ref="patentTableForm"
                :config="patentData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <!-- 标准规范表格 -->
          <Card :sub-title="standardData.title" :tip="standardData.tip">
            <div slot="content">
              <TableForm
                ref="standardTableForm"
                :config="standardData"
                style="margin: 20px"
              />
            </div>
          </Card>
          <Card v-if="personnelDetail.other" sub-title="其他成果">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.other)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.planning" sub-title="来校后工作规划">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.planning)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.prove" sub-title="成果材料">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.prove)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.recommendation" sub-title="专家推荐信">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.recommendation)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
          <Card v-if="personnelDetail.spouse_resume" sub-title="配偶简历">
            <el-link
              slot="content"
              type="primary"
              @click="handlePreview(personnelDetail.spouse_resume)"
            ><i class="el-icon-view el-icon--right" />预览</el-link>
          </Card>
        </el-col>
        <!-- 11 -->
        <!-- 专家评价-------------------------------------------------------------------------- -->
        <!-- <el-col :span="isLook ? 0 : 11"> -->
        <el-col v-if="true" :span="isLook ? 0 : 11" class="">
          <Evaluate
            v-if="role === '专家' && dialogVisible"
            :personnel-id="personnelId.toString()"
            :personnel-detail="personnelDetail"
            @refresh="refresh"
          />
          <Decision
            v-if="
              role === '评委' &&
                dialogVisible &&
                Object.keys(personnelDetail).length > 0
            "
            :census="census"
            :personnel="personnelDetail"
            :expert-list="expertList"
            :treatment="treatment"
            :personnel-id="personnelId.toString()"
            @refresh="refresh"
            @handlePreview1="handlePreview"
          />
        </el-col>
 
      </el-row>

    </div>

    <el-dialog
      width="70%"
      title="查看评审"
      :visible.sync="innerVisible"
      append-to-body
      :destroy-on-close="true"
    >
      <!-- 基本 -->
      <Review :all-data="allData" />
    </el-dialog>

    <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button
          type="primary"
          @click="dialogVisible = false"
        >确 定</el-button>
      </span> -->
    <!-- </el-dialog> -->
  </div>
</template>
<script>
import config from './config'
import smallConfig from './table_small_config'
import Evaluate from './components/Evaluate'
import Decision from './components/Decision'
import Review from './components/Review'
import { getPersonnelDetail } from '@/api/personnel'
import Card from '@/components/Card/index.vue'
import { Navbar, Sidebar } from '@/layout/components'
import { UserInfoTable } from '../../components/UserInfoTable'
import { boolean } from 'yargs'

export default {
  components: {
    Navbar,
    Evaluate,
    Decision,
    Review,
    Card,
    Sidebar,
    UserInfoTable
  },
  data () {
    return {
      title: '',
      baseUrl: process.env.VUE_APP_BASE_API,
      dialogVisible: false,
      // 主要项目表格
      mainProjectData: config.mainProjectData,
      // 主要著作表格
      mainBookData: config.mainBookData,
      // 主要获奖表格
      prizeWinningData: config.prizeWinningData,
      // 发明专利表格
      patentData: config.patentData,
      standardData: config.standardData,
      paperData: config.paperData,
      // 内层查看评审弹窗
      innerVisible: false,
      personnelDetail: {},
      allData: {},
      // role: sessionStorage.getItem('role'),
      role: localStorage.getItem('role'),
      isLook: false,
      big_or_small: 1,
      // 人才id
      personnelId: '',
      // 专家学术评价情况数据
      census: {},
      // 专家信息列表
      expertList: [],
      // 国家标准费用
      treatment: {}
    }
  },
  computed: {
    sidebar () {
      return this.$store.state.app.sidebar
    },
    device () {
      return this.$store.state.app.device
    },
    fixedHeader () {
      return this.$store.state.settings.fixedHeader
    },
    classObj () {
      return {
        hideSidebar: !this.sidebar.opened,
        openSidebar: this.sidebar.opened,
        withoutAnimation: this.sidebar.withoutAnimation,
        mobile: this.device === 'mobile'
      }
    }
  },
  created () {
    console.log(this.$route.query)
    const { id, flag } = this.$route.query
    console.log(id, flag)
    this.open(id, JSON.parse(flag))
    // 设置标题
    this.title = this.$route.meta.title
  },
  methods: {
    open (id, flag = true) {
      // 人才id
      this.personnelId = id
      if (
        flag ||
        this.role === '管理员' ||
        this.role === '超级管理员' ||
        this.role === '学院'
      ) {
        console.log(flag)
        console.log(this.role)
        this.isLook = true
        this.big_or_small = 1
      } else {
        this.isLook = false
        this.big_or_small = 0
        this.mainProjectData = smallConfig.mainProjectData
        this.paperData = smallConfig.paperData
        this.mainBookData = smallConfig.mainBookData
        this.prizeWinningData = smallConfig.prizeWinningData
        this.patentData = smallConfig.patentData
        this.standardData = smallConfig.standardData

        // this.clearWidth(this.mainProjectData.columns)
        // this.clearWidth(this.paperData.columns)
        // this.clearWidth(this.mainBookData.columns)
        // this.clearWidth(this.prizeWinningData.columns)
        // this.clearWidth(this.patentData.columns)
        // this.clearWidth(this.standardData.columns)
      }
      this.dialogVisible = true
      this.getPersonnelDetail(id)
    },
    clearWidth (data) {
      data.forEach(item => {
        delete item?.attr
      })
    },
    refresh () {
      this.dialogVisible = false
      // this.$emit('refresh')
      this.$router.go(-1)
    },
    handleClose () {
      this.dialogVisible = false
    },
    openInnerVisible () {
      this.innerVisible = true
    },
    // 获取人才详细资料
    async getPersonnelDetail (id) {
      const res = await getPersonnelDetail({ id })
      this.allData = res.data
      console.log('999',this.allData);
      // 专家学术评价情况
      this.census = res.data.census
      // 当前角色为评委时保存参与当前人才评价的专家信息
      if (this.role === '评委') {
        this.expertList = res.data.expert_name
        this.treatment = res.data.treatment
      }
      if (this.role === '学院') {
        this.personnelDetail = res.data
      } else {
        this.personnelDetail = res.data.personnel
      }

      this.$refs.projectTableForm.setData(this.personnelDetail.project)
      this.$refs.bookTableForm.setData(this.personnelDetail.work)
      this.$refs.winTableForm.setData(this.personnelDetail.award)
      this.$refs.patentTableForm.setData(this.personnelDetail.patent)
      this.$refs.paperTableForm.setData(this.personnelDetail.paper)
      this.$refs.standardTableForm.setData(this.personnelDetail.standard)

      // this.personnelDetail.teach_undergo =
      //   this.personnelDetail.teach_undergo.replaceAll('&quot;', '"')
      // this.personnelDetail.work_undergo =
      //   this.personnelDetail.work_undergo.replaceAll('&quot;', '"')
      // this.personnelDetail.teach_undergo = JSON.parse(
      //   this.personnelDetail.teach_undergo.replaceAll('&quot;', '"')
      // )
      // this.personnelDetail.work_undergo = JSON.parse(
      //   this.personnelDetail.work_undergo.replaceAll('&quot;', '"')
      // )
    },
    handlePreview (path) {
      console.log('path',path);
      const fileUrl = process.env.VUE_APP_BASE_API + path
      if (fileUrl.indexOf('.pdf') !== -1) { return window.open(fileUrl, '_target') }

      const url = encodeURIComponent(fileUrl)
      const officeUrl =
        'http://view.officeapps.live.com/op/view.aspx?src=' + url
      window.open(officeUrl, '_target')
    }
  }
}
</script>
<style lang="scss" scoped>
.look-info {
  width: calc(100% - 54px)
}
@import '~@/styles/mixin.scss';
@import '~@/styles/variables.scss';

.bgt{
  background: red;
  // width: 100vw;
  // height: 100vh;
  background-image: url('../../../public/2.png');
  background-repeat: no-repeat;
  background-position: 20%;
  background-size: 10%;
}
::v-deep *[data-v-2e6d7d8f]{
  padding: none;
}

.table{
    border-collapse: collapse;
    border-spacing: 0;
    background-color: #fff;
    display: table;
    width: 100%;
    max-width: 100%;
    width: 50vw;
    margin:0 auto;
  }
  .table td{
    text-align:center;
    vertical-align:middle;
    font-size: 14px;
    font-family: MicrosoftYaHei;
    color: #333333;
    font-weight: bold;
    padding: 8px 12px;

  }
  .table-bordered {
    border: 1px solid #ddd;
  }
//   *{
//     margin: 0px;
//     padding: 0px;
//   }
  .column{
    width:10vw;
    height:4vh;
    border:1px solid #333;
    background: #f1f1f1;
  }
  .value{
    width:15vw;
    height:4vh;
    border:1px solid #333;
  }

.app-wrapper {
  @include clearfix;
  position: relative;
  height: 100%;
  width: 100%;
  &.mobile.openSidebar {
    position: fixed;
    top: 0;
  }
}

  .pinshen{
    position: absolute;
    z-index: 999;
    top: 0;
    left: 0;
  }
  ::v-deep .el-dialog__header{
    padding: 0 !important;
 }
 ::v-deep .el-dialog__body{
    padding: 0 1vw 1.5vw 1vw;
    align-items: center;

 }
::v-deep.el-dialog {
  background-color: #f8f8f8;
}

.avatar-img {
  max-width: 138px;
  height: 164px;
  // overflow: hidden;
  margin: 0 auto;
  
  display: flex;
}
.el-row {
  display: flex;
  flex-wrap: nowrap;
}

.box-card {
  // background-image: url('../../../public/3.png');
  // background-repeat: no-repeat;
  // background-position: 10% 10%;
  // background-size: 50%;
  .left-title {
    height: 6vh;
    text-align: center;
    // font-size: 20px;
    font-family: MicrosoftYaHei;
    font-weight: bold;
    color: #333333;
  }
  .el-row:nth-child(2) {
    .el-col {
      .el-row {
        // line-height: 34px;
        border-bottom: 1px solid #333;
        .el-col {
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 14px;
          font-family: MicrosoftYaHei;
          font-weight: bold;
          color: #333333;
          min-height: 40px;
          border-right: 1px solid #333;
          border-bottom: none;

          &:nth-last-child(2n + 1) {
            font-size: 14px;
            font-family: MicrosoftYaHei;
            font-weight: bold;
            // color: #ff0913;
          }
        }
      }
    }
  }
  .other {
    .el-row {
      // line-height: 34px;
      border: 1px solid #333;
      border-top: none;
      font-size: 14px;
      font-family: MicrosoftYaHei;
      font-weight: bold;
      color: #333333;
      .el-col {
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid #333;
        min-height: 40px;
        border-right: 1px solid #333;
        border-bottom: none;

        &:nth-last-child(2n + 1) {
          // padding-left: 27px;
          box-sizing: content-box;
          // margin-right: -40px;
          font-size: 14px;
          font-family: MicrosoftYaHei;
          font-weight: bold;
          // color: #ff0913;
        }
        &:nth-last-child(1) {
          border-right: none;
        }
      }
    }

    .table-header {
      .el-col {
        color: #333 !important;
      }
    }
    .table-body {
      .el-col {
        // color: #ff0913;
      }
    }
  }
}

// ::v-deep.box-card .other .el-row .el-col {
//   margin-left: -28.5px;
//   .content {
//     text-align: center;
//     margin-right: -28.5px;
//   }
// }
// .pd-l {
//   padding-left: 55.5px !important;
//   box-sizing: content-box !important;
// }
// .mg-l {
//   margin-left: -78px !important;
//   div {
//   margin-right: -36px !important;

//   }
// }
// .pd-r {
//   padding-right: 30px !important;
//   box-sizing: content-box !important;
//   div {
//     margin-right: -30px;
//   }
// }

// ::v-deep.el-dialog__wrapper {
//   // width: calc(100% - 210px);
//   padding-left: 210px;
//   margin-top: 0;
//   box-sizing: border-box;
//   top: inherit;
//   left: inherit;
//   right: inherit;
//   bottom: inherit;
//   // z-index: 99999999;
// }
// ::v-deep.el-dialog.look-info {
//   margin-top: 0;
// }

// .main {
//   // padding-left: 210px;
//   position: fixed;
//   // width: calc(100% - 210px);
//   // height: auto;
//   left: 0;
//   top: 0;
//   right: 0;
//   bottom: 0;
// }

::v-deep .title-wrap {
  margin-bottom: 0;
}

.bg-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 600px;
  // z-index: -1;
}
.bg-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 500px;
}
.spouse_resume{
  color: #409EFF;
  font-size: 0.72917vw;
  position: absolute;
  left: 1350px;
  top: 852px;
  z-index: 1;
}
</style>
